<template>
	<view style="padding-bottom: 50upx;">
		<view class="qiyue">
			<text class="tb">学生研读报告查阅</text>
			<textarea class="bj" :value="content" placeholder="" disabled/>
		</view>
		<hengxian></hengxian>
		<view class="shenyue">
			<text class="tb">教师批阅打分</text>
			<select-lay :value="comment" name="name" :options="comments" @selectitem="selectitem" style="margin-top: 20upx;"></select-lay>
			<text class="nr">教师评语：</text>
			<textarea class="py" v-model="comment" value="" placeholder="" />
		</view>
		<view class="pingyue">
			<view class="pfss">
				<text>理论分析能力：</text>
				<input type="number" v-model="scores.reportScore1" value="8分">
				<text>（最高可打10分）</text>
			</view>
			<view class="pfss">
				<text>时间思维能力：</text>
				<input type="number" v-model="scores.reportScore2" value="8分">
				<text>（最高可打10分）</text>
			</view>
			<view class="pfss">
				<text>理论应用能力：</text>
				<input type="number" v-model="scores.reportScore3" value="8分">
				<text>（最高可打10分）</text>
			</view>
			<view class="pfss">
				<text>问题导向能力：</text>
				<input type="number" v-model="scores.reportScore4" value="8分">
				<text>（最高可打10分）</text>
			</view>
			<view class="pfss">
				<text>思维创新能力：</text>
				<input type="text" v-model="scores.reportScore5" value="8分">
				<text>（最高可打10分）</text>
			</view>
			<view class="pfss">
				<text>判断思维能力：</text>
				<input type="text" v-model="scores.reportScore6" value="8分">
				<text>（最高可打10分）</text>
			</view>
		</view>
		<!-- 保存 -->
		<view class="uni-padding-wrap uni-common-mt baocun">
			<button class="mini-btn" type="warn" size="mini" @click="tiao()">提交</button>
		</view>
	</view>
 </template>
<script>
	import wCalendar from "@/components/select-lay/select-lay.vue";
export default {
    data(){
        return{
			id:'',//学生id
			ids:'',//任务id
			score1:'',
			score2:'',
			score3:'',
			score4:'',
			score5:'',
			score6:'',
			comment:'',
            content:'',//实践报告内容
			scores:[],//建议分数
			comments:[],//建议评语
        }
    },
	onLoad(option) {
		this.id = option.id;
		this.ids = option.ids;
		this.getReport();
		this.getAdviseScore();
		this.getCommentListSelect();
	},
    methods:{
		//获取学生的实践报告
		getReport(){
			let that = this;
			that.pyReq(that.$http.getStuTaskedDetailByTea,{stuId:that.id,taskedId:that.ids},function(res){
				that.content = res.result.task10.content;
			})
		},
		//获取建议分数
		getAdviseScore(){
			let that = this;
			that.pyReq(that.$http.getAdviseScore,{},function(res){
				that.scores = res.result;
			})
		},
		//获取教师评语
		getCommentListSelect(){
			let that = this;
			that.pyReq(that.$http.getCommentListSelect,{},function(res){
				let comments = [];
				for(let i = 0;i<res.result.length;i++){
					let obj = {
						label : res.result[i].comment,
						value : res.result[i].comment,
					}
					comments[i] = obj;
				}
				that.comments=comments
				that.comment = comments[0].value;
			})
		},
		//选择评语
		selectitem(index,item){
			if(item == null){
				this.comment = '';
			}else {
			this.comment = item.value;
			}
			console.log(item);
		},
		tiao(){
			let that = this
			console.log(that.comment)
			let params = {
			  "stuId":that.id,
			  "taskId":that.ids,
			  "score1":that.scores.reportScore1,
			  "score2":that.scores.reportScore2,
			  "score3":that.scores.reportScore3,
			  "score4":that.scores.reportScore4,
			  "score5":that.scores.reportScore5,
			  "score6":that.scores.reportScore6,
			  "comment":that.comment
			}
			that.pyReq(that.$http.correctReport,params,function(res){
					  uni.navigateTo({
					  	url:'/pages/index/renwu/xshenglist?id='+that.ids,
					  })
			});
			
		}
    }
}
</script>
<style>
	.baocun{
		text-align: right;
		padding-top: 50upx;
	}
	.baocun button{
		width: 250upx;
		height: 50upx;
		font-size: 26upx;
		line-height: 50upx;
	}
	.piyue{
		background-color: #666666;
	}
	.bao{
		margin-right: 20upx;
	}
	.pfss{
		display: flex;
		justify-content: space-between;
		margin-top: 15upx;
	}
	.pfss text{
		font-size: 27upx;
		display: block;
		line-height: 40upx;
	}
	.pfss input{
		width: 260upx;
		height: 44upx;
		font-size: 26upx;
		text-align: center;
		background: #F3F3F3;
	}
	.py{
		width: 646upx;
		height: 220upx;
		border: 1upx solid #666666;
		margin-top: 25upx;
		border-radius: 10upx;
		padding: 20upx;
		font-size: 26upx;
	}
	.qiyue,.shenyue,.pingyue{
		margin: 30upx;
	}
	.shenyue text{
		display: block;
	}
	.tb{
		font-size: 30upx;
		font-weight: 700;
	}
	.nr{
		font-size: 26upx;
		margin-top: 30upx;
	}
	.bj{
		width: 100%;
		height: 340upx;
		font-size: 28upx;
		line-height: 45upx;
	}
</style>